package Main;

import java.io.IOException;
import java.rmi.RMISecurityManager;
import java.rmi.registry.LocateRegistry;
import java.sql.SQLException;
import java.util.List;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.registerserver.service.ServiceImpl;
import com.registerserver.service.IService;

public class ServerMain {
	
	public static void main(String[] args) throws SQLException, IOException, NamingException {
		LocateRegistry.createRegistry(5555);
		String url = "rmi://localhost:5555/RegisterCourse";
		IService service = new ServiceImpl();
		Context ctx = new InitialContext();
		ctx.bind(url, service);
		System.out.println("server is running...");
	}
}
